package cn.netshop.pojo.;

import com.alibaba.fastjson.JSONObject;

/**
 * undo_log实体类
 * 
 * @author 
 *
 */
public class UndoLog {
	/***/
	private Long id; 
	/***/
	private Long branchId; 
	/***/
	private String xid; 
	/***/
	private Object rollbackInfo; 
	/***/
	private Integer logStatus; 
	/***/
	private java.time.Instant logCreated; 
	/***/
	private java.time.Instant logModified; 
	/***/
	private String ext; 
	/**
	 * 实例化
	 */
	public UndoLog() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */
	public UndoLog(JSONObject obj) {
		this();
		if (obj.get("id") instanceof Number) {
			this.setId(((Number) obj.get("id")).longValue());
		}
		if (obj.get("branchId") instanceof Number) {
			this.setBranchId(((Number) obj.get("branchId")).longValue());
		}
		if (obj.get("xid") instanceof String) {
			this.setXid((String) obj.get("xid"));
		}
		this.setRollbackInfo(obj.get("rollbackInfo"));
		if (obj.get("logStatus") instanceof Number) {
			this.setLogStatus(((Number) obj.get("logStatus")).intValue());
		}
		this.setLogCreated(obj.get("logCreated"));
		this.setLogModified(obj.get("logModified"));
		if (obj.get("ext") instanceof String) {
			this.setExt((String) obj.get("ext"));
		}
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getId() != null) {
			result.put("id",this.getId());
		}
		if (this.getBranchId() != null) {
			result.put("branchId",this.getBranchId());
		}
		if (this.getXid() != null) {
			result.put("xid",this.getXid());
		}
		if (this.getRollbackInfo() != null) {
			result.put("rollbackInfo",this.getRollbackInfo());
		}
		if (this.getLogStatus() != null) {
			result.put("logStatus",this.getLogStatus());
		}
		if (this.getLogCreated() != null) {
			result.put("logCreated",this.getLogCreated());
		}
		if (this.getLogModified() != null) {
			result.put("logModified",this.getLogModified());
		}
		if (this.getExt() != null) {
			result.put("ext",this.getExt());
		}
		return result;
	}
	
	
	/**
	 * 获取id
	 * 
	 * @return
	 */
	public Long getId() {
		return id;
	}

	/**
	 * 设置id
	 * 
	 * @param id
	 */
	public void setId(Long id) {
		this.id = id;
	}
	
	/**
	 * 获取branchId
	 * 
	 * @return
	 */
	public Long getBranchId() {
		return branchId;
	}

	/**
	 * 设置branchId
	 * 
	 * @param branchId
	 */
	public void setBranchId(Long branchId) {
		this.branchId = branchId;
	}
	
	/**
	 * 获取xid
	 * 
	 * @return
	 */
	public String getXid() {
		return xid;
	}

	/**
	 * 设置xid
	 * 
	 * @param xid
	 */
	public void setXid(String xid) {
		this.xid = xid;
	}
	
	/**
	 * 获取rollbackInfo
	 * 
	 * @return
	 */
	public Object getRollbackInfo() {
		return rollbackInfo;
	}

	/**
	 * 设置rollbackInfo
	 * 
	 * @param rollbackInfo
	 */
	public void setRollbackInfo(Object rollbackInfo) {
		this.rollbackInfo = rollbackInfo;
	}
	
	/**
	 * 获取logStatus
	 * 
	 * @return
	 */
	public Integer getLogStatus() {
		return logStatus;
	}

	/**
	 * 设置logStatus
	 * 
	 * @param logStatus
	 */
	public void setLogStatus(Integer logStatus) {
		this.logStatus = logStatus;
	}
	
	/**
	 * 获取logCreated
	 * 
	 * @return
	 */
	public java.time.Instant getLogCreated() {
		return logCreated;
	}

	/**
	 * 设置logCreated
	 * 
	 * @param logCreated
	 */
	public void setLogCreated(java.time.Instant logCreated) {
		this.logCreated = logCreated;
	}
	
	/**
	 * 获取logModified
	 * 
	 * @return
	 */
	public java.time.Instant getLogModified() {
		return logModified;
	}

	/**
	 * 设置logModified
	 * 
	 * @param logModified
	 */
	public void setLogModified(java.time.Instant logModified) {
		this.logModified = logModified;
	}
	
	/**
	 * 获取ext
	 * 
	 * @return
	 */
	public String getExt() {
		return ext;
	}

	/**
	 * 设置ext
	 * 
	 * @param ext
	 */
	public void setExt(String ext) {
		this.ext = ext;
	}

	@Override
	public String toString() {
		return "UndoLog [id=" + id + " , branchId=" + branchId + " , xid=" + xid + " , rollbackInfo=" + rollbackInfo + " , logStatus=" + logStatus + " , logCreated=" + logCreated + " , logModified=" + logModified + " , ext=" + ext + "  ]";
	
	}
	
	
}
